<?php


namespace app\index\controller;


use app\BaseController;
use app\index\business\contentBus;
use think\facade\View;

class Content extends BaseController
{
    public function index(){
        $id = $this->request->param('id');
        if(empty($id)){
            $id = 0;
        }
        View::assign('id',$id);
        View::assign('title','关于我们');
        return View::fetch();
    }
    public function getList(){
        $contentBus = new contentBus();
        try {
            $res = $contentBus->getListBus();
        } catch (\Exception $exception){
            return show(config('status.error'),$exception->getMessage());
        }
        return show(config('status.success'),'查询成功',$res);
    }
    public function getDetail(){
        $id = $this->request->param('id');
        $contentBus = new contentBus();
        try {
            $res = $contentBus->getDetailBus($id);
        } catch (\Exception $exception){
            return show(config('status.error'),$exception->getMessage());
        }
        return show(config('status.success'),'查询成功',$res);
    }
}